package design_pattern.builder;

/**
 * Created by WeiDingKuo on 2017/10/26 15:27
 * <p>
 * 监工，负责复杂对象的创建，抽象组件的建造顺序
 * 具体组件的建造交由具体的builder去实现
 */
public class BuilderDirector {
    private Builder builder;

    public BuilderDirector(Builder builder) {
        this.builder = builder;
    }

    public Person buildPerson() {
        this.builder.buildHead();
        this.builder.buildBody();
        this.builder.buildHand();
        this.builder.buildFoot();
        return this.builder.buildPerson();
    }
}
